<?php

declare(strict_types=1);
/**
 * This file is part of habo_new_media.
 *
 * @link     https://www.berlen.cn/
 * @contact  tech@berlen.cn
 * @license  http://gitlab.rehou.cn/habo/habo_new_media/-/blob/master/README.md
 */
namespace app\service\qq;

use app\enum\QqCodeEnum;
use app\service\BaseService;

class QqService extends BaseService
{
    /**
     * 获取请求头部.
     */
    public static function getHeader(): array
    {
        return [];
    }

    /**
     * 判断返回是否正确.
     */
    public static function isResponseSuccess(int $code = -10000): bool
    {
        return $code == QqCodeEnum::SUCCESS;
    }

    /**
     * 参数初始化.
     */
    public static function initParam(array $params = []): array
    {
        $now = time();
        $params['timestamp'] = $now;
        $params['nonce'] = uniqid(strval($now));

        return $params;
    }
}
